﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HB.HttpServer;
using HB.HttpServer.Model;

namespace Sample.Server.Filter
{
    internal class ActionFilter : IActionFilter
    {
        public void OnActionExecuted(ActionExecutingData e)
        {
            Console.WriteLine("OnActionExecuted" + e.Method.Router);
            //执行后记录，此时已无法拦截
            //此处省略一些代码
        }

        public void OnActionExecuting(ActionExecutingData e)
        {
           
            Console.WriteLine("OnActionExecuting" + e.Method.Router);
            //符合某种条件，执行前拦截返回
            //if (*)
            //{
            //    e.ReturnCode(System.Net.HttpStatusCode.NotFound);
            //}
        }
    }
}
